import { BuildTaskResult } from "../model/TaskResultDBSchema";
import { Rule } from "../model/Rule";
import { BuildTaskParam } from "../model/BuildTask";

const requiredRule: Rule = {
  required: true,
  msg: "参数缺失",
};

export const timingDataRule: Partial<Record<keyof BuildTaskResult, Rule[]>> = {
  start: [requiredRule],
  end: [requiredRule],
  status: [requiredRule],
  type: [requiredRule],
  taskId: [requiredRule],
};

export const addTaskParamRule: Partial<Record<keyof BuildTaskParam, Rule[]>> = {
  taskTitle: [requiredRule],
  taskList: [requiredRule],
};
